Green NDVI – Chlorophyll-sensitive vegetation index
Free GEE Code • Copy & Use
GNDVI – Green Normalized Difference Vegetation Index
GNDVI is a vegetation index similar to NDVI but uses the Green band instead of Red,
making it more sensitive to chlorophyll concentration and useful for early stress detection
in crops and vegetation.
1. Scientific Definition
The Green Normalized Difference Vegetation Index (GNDVI) is a spectral index
that compares Near-InfraRed (NIR) reflectance with the Green band instead of the Red band.
Because the green reflectance is more tightly linked to leaf chlorophyll content, GNDVI is
particularly useful for monitoring crop vigor and early signs of stress.
Complementing NDVI in dense canopies or sensitive crop monitoring.
2. Data & Bands for GNDVI
Common Sensors & Bands
Sentinel-2 (ESA) – 10 m
Green: B3 (~560 nm)
NIR: B8 (~842 nm)
Landsat 8/9 OLI – 30 m
Green: B3
NIR: B5
Good Practice
Use atmospherically corrected surface reflectance products.
Filter scenes by cloud percentage and use cloud masks where available.
Clip the final GNDVI raster to your Area of Interest (AOI) before exporting.
Use consistent dates and acquisition conditions when comparing multiple scenes.
Palette Suggestion
A GNDVI color palette similar to NDVI:
[ "#440154", "#3b528b", "#21908c", "#5dc963", "#fde725" ]
3. Google Earth Engine Code – GNDVI for Any AOI
Steps: open code.earthengine.google.com → New Script → paste the code →
draw your AOI as geometry on the map → click Run.
Then export GNDVI as GeoTIFF to Google Drive.
// GNDVI for any Area of Interest (AOI) using Sentinel-2 SR
// -------------------------------------------------------
// 1) Go to: https://code.earthengine.google.com
// 2) Click "New Script" and paste this code.
// 3) On the map: draw your AOI (Polygon/Rectangle).
// It will appear as a variable named 'geometry' in the left panel.
// 4) Click "Run" to display GNDVI.
// 5) In the Tasks tab, click "Run" to export GNDVI to Google Drive.
// -------------------------------------------------------
// 1. Define Area of Interest (AOI)
// -------------------------------------------------------
// Use the geometry you draw on the map:
var roi = geometry; // Make sure a 'geometry' object exists in the left panel
// Center the map on the AOI
Map.centerObject(roi, 11);
// -------------------------------------------------------
// 2. Define time range
// Adjust dates according to your study period
// -------------------------------------------------------
var startDate = '2023-01-01';
var endDate = '2023-12-31';
// -------------------------------------------------------
// 3. Load Sentinel-2 Surface Reflectance collection
// -------------------------------------------------------
var s2 = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(roi)
.filterDate(startDate, endDate)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
// Select Green (B3) and NIR (B8) + RGB for optional visualization
.select(['B3','B8','B4','B3','B2'], ['GREEN','NIR','R','G','B']);
// Create a median composite and clip to AOI
var image = s2.median().clip(roi);
// -------------------------------------------------------
// 4. Compute GNDVI
// GNDVI = (NIR - GREEN) / (NIR + GREEN)
// -------------------------------------------------------
var gndvi = image.normalizedDifference(['NIR', 'GREEN']).rename('GNDVI');
// -------------------------------------------------------
// 5. Visualization on the map
// -------------------------------------------------------
var gndviVis = {
min: -1,
max: 1,
palette: [
'#440154', // low (water / bare / non-vegetated)
'#3b528b',
'#21908c',
'#5dc963',
'#fde725' // high (dense, chlorophyll-rich vegetation)
]
};
// Add GNDVI layer to the map
Map.addLayer(gndvi, gndviVis, 'GNDVI (Sentinel-2)', true);
// Optionally, also show a true color composite for context
var s2_rgb = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(roi)
.filterDate(startDate, endDate)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
.select(['B4','B3','B2']) // RGB
.median()
.clip(roi);
Map.addLayer(s2_rgb, {min:0, max:3000}, 'True Color (RGB)', false);
// -------------------------------------------------------
// 6. Export GNDVI as GeoTIFF to Google Drive
// -------------------------------------------------------
Export.image.toDrive({
image: gndvi,
description: 'GNDVI_Export',
fileNamePrefix: 'GNDVI_Export',
region: roi,
scale: 10, // Sentinel-2 native resolution for B8/B3
crs: 'EPSG:4326',
maxPixels: 1e13
});
// End of script